//
//  ImageLabelView.m
//  Study1
//
//  Created by Zeak on 2017/2/15.
//  Copyright © 2017年 Zeak. All rights reserved.
//

#import "ImageLabelView.h"
#import "UIView+YZTCView.h"

#define IMG_WIDTH 32.7

@implementation ImageLabelView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(instancetype)initWithFrame:(CGRect)frame imgName:(NSString *)imgStr labelName:(NSString *)labelStr{
    
    if (self = [super initWithFrame:frame]) {
        UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, IMG_WIDTH, IMG_WIDTH)];
        imgView.image = [UIImage imageNamed:imgStr];
        
        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(imgView.yzLeft + 4, imgView.yzBottom + 4, 24.7, 12)];
        label.text = labelStr;
        label.font = [UIFont boldSystemFontOfSize:12];
        
        
        [self addSubview:imgView];
        [self addSubview:label];
        
    }
    return self;

    
}
@end
